@{
    Layout=null;
}
@model IEnumerable<Product>;

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Index</title>
    <link rel="stylesheet" href="~/css/base.css">
</head>
<body>
    <div id="container">
        <h1>Index</h1>
        <div id="top">
            <input type="text" id="_text" placeholder="请输入关键字">
            <input type="button" value="搜索" id="btnQuery">
            <input type="button" value="新增" id="btnAdd">
        </div>
        <table id="tb">
            <tr>
                <th>Id</th>
                <th>商品名称</th>
                <th>供应商名称</th>
                <th>价格</th>
                <th>库存数量</th>
                <th>操作</th>
            </tr>
            @foreach (var item in Model)
            {
                <tr class="trs">
                    <td>@item.Id</td>
                    <td>@item.ProductName</td>
                    <td>@item.Supplier</td>
                    <td>@item.Price</td>
                    <td>@item.Stock</td>
                    <td>
                        <input type="button" value="编辑" onclick="btnEdit(@item.Id)">
                        <input type="button" value="删除" onclick="btnDel(@item.Id)">
                    </td>
                </tr>
            }
        </table>
    </div>

    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/js/base.js"></script>
</body>
</html>